$(function () {
  mui('.mui-scroll-wrapper').scroll({
    deceleration: 0.0005, //flick 减速系数，系数越大，滚动速度越慢，滚动距离越小，默认值0.0006
  })

  $('#1st-list').find('a').eq(0).addClass('active')
  var html = template('2nd-cate', { res: 0 })
  $('#2nd-list').html(html)

  $('#1st-list').on('click', 'a', function () {
    $(this).addClass('active').siblings().removeClass('active')

    if ($(this).index() == 0) {
      var html = template('2nd-cate', { res: 0 })
      $('#2nd-list').html(html)
    } else if ($(this).index() == 1) {
      var html = template('2nd-cate', { res: 1 })
      $('#2nd-list').html(html)
    } else if ($(this).index() > 1) {
      var html = template('2nd-cate', { res: 3 })
      $('#2nd-list').html(html)
    }
  })
})
